{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fswiss\fprq2\fcharset128 Microsoft Sans Serif;}{\f5\fswiss\fprq2\fcharset128 Microsoft Sans Serif;}{\f6\fswiss\fprq2\fcharset0 Arial Unicode MS;}{\f7\fnil\fprq2\fcharset0 MS Mincho;}{\f8\fnil\fprq0\fcharset0 Tahoma;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\snext1 Normal;}
{\s2\sb240\sa120\keepn\rtlch\af2\afs28\lang255\ltrch\dbch\af7\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
{\s3\sa120\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext3 Body Text;}
{\s4\sa120\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon3\snext4 List;}
{\s5\sb120\sa120\rtlch\af8\afs24\lang255\ai\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext5 caption;}
{\s6\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext6 Index;}
{\s7\sb120\sa120\rtlch\afs24\lang255\ai\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext7 caption;}
{\*\cs9\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 Numbering Symbols;}
}
{\info{\creatim\yr2011\mo7\dy27\hr4\min26}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3000}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
{\*\pgdscno0}\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\ql\rtlch\af4\afs24\lang255\ab\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\b\loch\f5\fs24\lang1033\b {\rtlch \ltrch\loch\f5\fs24\lang1033\i0\b Minimal Sample}
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 This sample shows how to create a very basic framework in setting up an application that will create a scene, respond to input, and render the scene to the screen. This process can be summed up as the following steps:}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 1) Setup Engine Services; this includes the render system, windowing, and input. }
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 For example, the sample creates the following services:}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Direct3D10 Render System}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Windows Forms Window Provider}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Windows Keyboard Provider}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Windows Mouse Provider}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 The engine is split into a number of services that provides access to concrete implementations of engine objects. The render system is the only required service, the rest are optional (e.g. still able to render to texture without a window or input).}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Services allows the engine to be modularized, meaning components can be added/removed/mixed or new components created, such as a new render system implementation for a previously unsupported graphics API. Because services are defined by an interface, the i
mplementation of a service is de-coupled from all client code that may rely on it, such as other services. This is the "abstraction layer" that allows the engine to support multiple graphics APIs and platforms.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 2) Create a window. Since we've set up the windows form windowing service, we'll create a window that is backed by a form or a control (depending on if the window is primary/secondary). Secondary windows create a control that can be used to attach to a win
dows form application.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 3) Create a camera. A camera defines the viewport that the scene is rendered to (the subimage, or whole part of the window) as well as the view/projection matrices in order to properly render the scene to the monitor's screen. We set the current camera tha
t will be automatically used by the engine to the renderer, which we query from the render system.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Additionally, it tends to be a good idea to set a callback to the window's {\rtlch\ltrch\hich\b\loch\b ClientSizedChanged} event that will modify the camera's viewport and projection based on the window's dimensions.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 4) Create a content manager to load/manage your content. The content manager allows you to tap into the content pipeline to import and cache content. Your content can be split up amongst multiple managers (e.g. each game level uses a content manager, GUI c
ontent to another, etc). This is a good idea because you can unload all the content of a manager at once.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 In order to import files that are not saved in the engine's binary format or material script format, you will need to add resource loaders to the content manager. For example, {\rtlch\ltrch\hich\b\loch\b DXSLoader }and {\rtlch\ltrch\hich\b\loch\b DDSLoader} for {\rtlch\ltrch\hich\b\loch\b DXS }model files and {\rtlch\ltrch\hich\b\loch\b DDS} images. These are two of the
 many resource loaders the engine implements in the {\rtlch\ltrch\hich\b\loch\b Tesla.Content.Loaders} assembly. They are in a separate assembly from the core engine assembly because they may not be supported by all platforms. }
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Typically, when releasing your application, all your content will be previously compiled into a {\rtlch\ltrch\hich\b\loch\b TEBO} binary file or a {\rtlch\ltrch\hich\b\loch\b TEM} material script. This not only allows your application to be cross-platform (e.g. the resource loaders will not be compatible with Xbo
x), but will speed up loading times since your content has already been preprocessed and exists in a format that is very close to the runtime format.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 5) Create a timer, this is used to interpolate between update calls.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 6) Create a window host, add a callback that will call your Update/Render loop ("{\rtlch\ltrch\hich\b\loch\b Game Loop}"), and run the host.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 A window host provides a generic, non-specific way of hosting your application and starting a standard message loop on the current thread (on Windows, it's more or less {\rtlch\ltrch\hich\b\loch\b Application.Run()}). It also provides a means for your game loop to be called whenever t
he application is Idle, or done processing messages.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 7) Cleanup - once we're exiting the program, be sure to call {\rtlch\ltrch\hich\b\loch\b Engine.CleanUpResources()}. This will call dispose on any service providers that implement {\rtlch\ltrch\hich\i\loch\i IDisposable}, and remove all services. For example, this will clean up all outstanding graphics objects th
at have not yet been disposed of. }
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs24\lang255\ab\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\b\loch\f5\fs24\lang1033\b {\rtlch \ltrch\loch\f5\fs24\lang1033\i0\b The Game Loop}
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 In the sample, our game loop does four things:}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 1) If we're exiting (e.g. pressed Escape), unload content, call {\rtlch\ltrch\hich\b\loch\b Exit()} on the host, and clean up resources.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 If we're not exiting, update the timer and:}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 2) Check Input. }
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 3) Update the scene. This tends to be a call to the root node's {\rtlch\ltrch\hich\b\loch\b Update() }method, which takes in the timer.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 4) Render the scene.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 We check input before calling Update() on the scene's root node, so if we change the geometric state of any scene object, it will be picked up in the proceeding Update() call.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs24\lang255\ab\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\b\loch\f5\fs24\lang1033\b {\rtlch \ltrch\loch\f5\fs24\lang1033\i0\b Rendering}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 The steps for rendering to a window that you have created are as follows:}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 1) Call {\rtlch\ltrch\hich\b\loch\b Clear() }on the window's swap chain.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 2) Call {\rtlch\ltrch\hich\b\loch\b OnDraw()} on the scene's root node by passing the render system's renderer object. This is a cull pass (using the renderer's currently active camera) and will either draw geometry immediately to the backbuffer, or add geometry to the renderer's rend
er queue.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 3) Sort, Render, Clear the render queue. The render queue will contain objects that have been added in the cull pass until you clear it. This means you can work with the current visible set of data multiple times, or keep accumulating objects to render fro
m other scene graphs. Keep this in mind for more advanced rendering.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 4) Call {\rtlch\ltrch\hich\b\loch\b Present() }on the window's swap chain. This flips the back/front buffers and your frame will appear on the}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 screen.}
\par }